<script>
	import Vue from 'vue';
	export default {
		globalData: {
			openid:'',
			wechatuserinfo: '',
			userinfo: '',
			site_url: "http://192.168.10.106:7001",
			// site_url: "http://huangyuze.top",
			sign_key: "400d069a791d51ada8af3e6c2979bcd7",
			login_jump: {
				'page': '', 
				'keyword': '',
				'data': {}
			}, //登录后跳转的页面及数据 
			open_shuati_info_num: 0, //打开刷题内页的次数, 用于控制是否显示滑动提示
			open_kaoshi_info_num: 0, //打开考试内页的次数, 用于控制是否显示滑动提示
			//存储考试时 做完的题数据 题id1 : {题号1, 题号2, ...}, 题id2: {....}
			kaoshi_tiend: {}
		},
		onLaunch: function() {
			uni.getSystemInfo({
				success: function(e) {
					// #ifndef MP
					Vue.prototype.StatusBar = e.statusBarHeight;
					if (e.platform == 'android') {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
					};
					// #endif

					// #ifdef MP-WEIXIN
					Vue.prototype.StatusBar = e.statusBarHeight;
					let custom = wx.getMenuButtonBoundingClientRect();
					Vue.prototype.Custom = custom;
					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight + 4;
					// #endif		

					// #ifdef MP-ALIPAY
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif
				}
			});
			// uni.hideTabBar();
			const updateManager = uni.getUpdateManager();
			updateManager.onCheckForUpdate(function(res) {
				// 请求完新版本信息的回调
			});
			// 初始化录音管理器
			this.$store.commit('initRECORD')
			// 初始化登录状态
			this.$store.dispatch('initLogin')
			// // 监听键盘高度变化
			uni.onKeyboardHeightChange(res => {
			  this.$store.commit('changeKeyboardHeight',res.height)
			})
			uni.setStorageSync('USER_INFO',{
				id: 1836060178,
				 userName: "1_15272345792",
				 type: 1,
				 status: 0,
				 whitelistAuthority: 0,
				 createTime: 1556350631190,
				 salt: "[B@46340725",
				 tokenVersion: 0,
				 ban: 0,
				 baoyueVersion: -2,
				 donateVersion: 0,
				 vipType: 1,
				 viptypeVersion: 1579884048264,
				 anonimousUser: false,})
			uni.setStorageSync('COOKIE',
				'MUSIC_R_T=1579314831460; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/neapi/feedback;;NMTID=00OXf5UpvGdkQqWHERaiqEv0xHRURoAAAF-dVtASg; Max-Age=315360000; Expires=Sun, 18 Jan 2032 02:40:21 GMT; Path=/;;MUSIC_A_T=1556350631190; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/eapi/feedback;;__csrf=6dbde2fbc4941178665d505865f7113b; Max-Age=1296010; Expires=Fri, 4 Feb 2022 02:40:31 GMT; Path=/;;MUSIC_A_T=1556350631190; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/eapi/clientlog;;MUSIC_R_T=1579314831460; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/weapi/feedback;;MUSIC_R_T=1579314831460; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/wapi/clientlog;;MUSIC_R_T=1579314831460; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/eapi/clientlog;;MUSIC_A_T=1556350631190; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/openapi/clientlog;;MUSIC_R_T=1579314831460; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/neapi/clientlog;;MUSIC_R_T=1579314831460; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/api/clientlog;;MUSIC_A_T=1556350631190; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/api/feedback;;MUSIC_A_T=1556350631190; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/neapi/feedback;;__remember_me=true; Max-Age=1296000; Expires=Fri, 4 Feb 2022 02:40:21 GMT; Path=/;;MUSIC_R_T=1579314831460; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/weapi/clientlog;;MUSIC_A_T=1556350631190; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/weapi/feedback;;MUSIC_A_T=1556350631190; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/api/clientlog;;MUSIC_A_T=1556350631190; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/weapi/clientlog;;MUSIC_A_T=1556350631190; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/wapi/clientlog;;MUSIC_U=d738393a963138ca6af65fccf544618b85cc1d59868353169d66eed52022bb09993166e004087dd3d78b6050a17a35e705925a4e6992f61d07c385928f88e8de; Max-Age=1296000; Expires=Fri, 4 Feb 2022 02:40:21 GMT; Path=/;;MUSIC_R_T=1579314831460; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/eapi/feedback;;MUSIC_R_T=1579314831460; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/openapi/clientlog;;MUSIC_A_T=1556350631190; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/neapi/clientlog;;MUSIC_A_T=1556350631190; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/wapi/feedback;;MUSIC_R_T=1579314831460; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/api/feedback;;MUSIC_R_T=1579314831460; Max-Age=2147483647; Expires=Tue, 7 Feb 2090 05:54:28 GMT; Path=/wapi/feedback;;MUSIC_SNS=; Max-Age=0; Expires=Thu, 20 Jan 2022 02:40:21 GMT; Path=/');
			
			updateManager.onUpdateReady(function(res) {
				uni.showModal({
					title: '更新提示',
					content: '新版本已经准备好，是否重启应用？',
					success(res) {
						if (res.confirm) {
							// 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
							updateManager.applyUpdate();
						}
					}
				});

			});

			updateManager.onUpdateFailed(function(res) {
				// 新的版本下载失败
			});
			
		},
		onShow: function() {
			//#ifdef MP-WEIXIN
			wx.showShareMenu({
				withShareTicket: true,
				menus: ['shareAppMessage', 'shareTimeline']
			})
			//#endif
		},
		onHide: function() {
			// console.log('App Hide');
		}
	};
</script>

<style  lang="scss">
	@import "@/common/free.css";
	@import 'colorui/icon.css';
	@import "@/common/free-icon.css";
	@import 'colorui/main.css';
	@import "@/common/App.scss";
	@import "@/common/icon.css";
	@import "uview-ui/index.scss";
	@import "static/css/iconfont.css";

	page {
		font-size: 32rpx;
		line-height: 1.7;
	}

	.container {
		padding: 20rpx;
		overflow: hidden;
	}

	// 发布按钮
	.plus-box {
		background-color: $themes-color;
		width: 110rpx;
		height: 110rpx;
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		position: fixed;
		bottom: 60rpx;
		right: 30rpx;
		z-index: 999;
		box-shadow: 0 0 10rpx #333;
	}

	.plus-box:active {
		background-color: #999;
	}

	.f-wrap {
		padding: 20rpx;
		border-radius: 10rpx;
		box-shadow: 5rpx 5rpx 20rpx #e6e6e6;
		background-color: #FFFFFF;
		margin-bottom: 20rpx;
	}

	.f-wrap>.title {
		font-weight: bold;
		margin-bottom: 20rpx;
	}

	.f-fixed {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		padding: 20rpx 20rpx 50rpx 20rpx;
		z-index: 999;
		background-color: #fff;
	}

	/* 隐藏滚动条 */
	::-webkit-scrollbar {
		display: none;
		width: 0 !important;
		height: 0 !important;
		-webkit-appearance: none;
		background: transparent;
	}
</style>
